<%-- 
    Document   : pertanyaan_jadual_penerbangan
    Created on : Jul 12, 2012, 9:53:44 AM
    Author     : faizal.azlee(Theta-Edge Bhd)
--%>
<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>        
         <script type="text/javascript">
            $(document).ready(function(){
                $('form').submit( function () {
                    return formValidation();
                }); 
                
                if(typeof String.prototype.trim !== 'function') {
                    String.prototype.trim = function() {
                      return this.replace(/^\s+|\s+$/g, ''); 
                    }
                  }
            });
            function resetAll(){
                document.getElementById("noAkaun").value = "";
                document.getElementById("noKp").value = "";
            }
            function validate(){
                if(document.getElementById("noAkaun").value.length != 15){
                    alert("Masukkan nombor akaun yang betul");
                    return false;
                }
                else if(document.getElementById("noKp").value.trim().length < 1){
                    alert("Masukkan Nombor pengenalan yang betul");
                    return false;
                }
                else {
                    return true;
                }
            }
            function validate1(f){
                if(validate()){
                    f.action = "${pageContext.request.contextPath}/haji?semakJadualPenerbangan"
                    f.submit();
                }
            }
        </script>
    </head>
    <body>
        <s:messages/>
        <s:errors/> 
        <br/>
        <s:form beanclass="th.stripes.action.HajiActionBean">
            <div id="content">
                <div id="logo">
                    <span>
                        <img src="${pageContext.request.contextPath}/images/img/ribbon.png"/>               
                    </span>
                </div>
                <h3>
                    Semak Jadual Penerbangan
                </h3>                  
                <p>
                    <label>No. Akaun TH</label>:
                    <s:text name="haji.noAkaun" id="noAkaun" maxlength="15"/>
                </p>
                <p>
                    <label>No. KP Semasa </label>:
                    <s:text name="haji.noKp" id="noKp" readonly="true" maxlength="12"/>
                </p>
                
                <p align="center">                    
                    <s:button name="check" value="Semak" onclick="validate1(this.form)" class="button green"/>
                    <s:button name="reset" value="Isi Semula" onclick="resetAll()" class="button green"/>
                </p>
            </div>
        </s:form>
    </body>
</html>